import { createRouter, createWebHistory } from 'vue-router'
import index from '../components/navrouter/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/index',
    },
    {
      path: '/index',
      name: 'index',
      component: index
    },
    {
      path: '/recommend',//热门推荐页面
      name: 'recommend',
      component: () => import('../components/navrouter/recommend.vue')
    },
    {
      path: '/strategy',//旅游攻略
      name: 'strategy',
      component: () => import('../components/navrouter/strategy.vue'),
      children: [
        {
          path: '/innerArea',//国内地区推荐
          name: 'innerArea',
          component: () => import('../components/icons/cityName.vue'),

        },
        {
          path: '/userHotRec',//用户热榜
          name: 'userHotRec',
          component: () => import('../components/icons/userHotRec.vue')
        },
        {
          path: '/overseas',//知名国外
          name: 'overseas',
          component: () => import('../components/icons/overseas.vue')
        },
      ]
    },
    {
      path: '/weather',//地图天气服务
      name: 'weather',
      component: () => import('../components/navrouter/weather.vue')
    },
    {
      path: '/writeArticle',//写文章发布模块
      name: 'writeArticle',
      component: () => import('../components/navrouter/writeArticle.vue')
    },
    {
      path: '/beijing',//国内地区推荐
      name: 'beijing',
      component: () => import('../components/viewCity.vue'),
    },
  ]
})

export default router
